import { request } from "@/utils/request";

// 获取分类树
export const getCategory = (data: {
  status: number | null | string;
  categoryName: string | null;
  // current: number | null;
  // size: number | null;
}) => {
  return request("merchant/category/getCategory", data);
};

// 获取机构列表
export const getMerchantInsSimpleList = () => {
  return request("merchant/merchantIns/simpleList", {});
};

// 上下线分类
export const onlineCategory = (data: { id: number, name: any }) => {
  return request("merchant/category/onlineCategory", data);
};

// 新增或修改商品分类
export const saveOrUpdateCategory = (data: any) => {
  return request("merchant/category/saveOrUpdateCategory", data);
};

// 新增商家
export const addBusinesManagement = (data: any) => {
  return request("merchant/store/addStore", data);
};
// 修改商家
export const setBusinesManagement = (data: any) => {
  return request("merchant/store/updateStore", data);
};

// 删除商家
export const delBusinesManagement = (data: any) => {
  return request("merchant/store/deleteStore", data);
};

// 停用/启用商家
export const setBusinesManagementStatus = (data: any) => {
  return request("merchant/store/onlineStore", data);
};

// 获取单个商家
export const getOneStoreMerchant = (data: any) => {
  return request("merchant/store/getOneStore", data);
};

// 修改密码
export const updatePassword = (data: any) => {
  return request("merchant/store/updatePassword", data);
};

// 获取商家配信息
export const getOneStoreConfig = (data: any) => {
  return request("merchant/storeConfig/getOneStoreConfig", data);
};

// 新增或者修改商家配置（传id为修改）
export const saveOrUpdateStore = (data: any) => {
  return request("merchant/storeConfig/saveOrUpdateStore", data);
};

// 开启关闭余额扣款
export const updDeductStatus = (data: any) => {
  return request("merchant/store/updDeductStatus", data);
};


